package com.sunducation.wts.room

import androidx.room.TypeConverter
import java.util.*


//类型转换，date转long,long转date， 数据库和对象自动转换
object DateConverters {
    @TypeConverter
    fun  fromTimestamp(value: Long): Date {
        return  Date(value)
    }

    @TypeConverter
    fun  dateToTimestamp(date: Date): Long {
        return date.getTime()
    }
}